package com.hec.yygh.common.handler;

import com.hec.yygh.common.result.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(value = Exception.class)  //捕获异常类型
    public R error(Exception e){
        return R.error();
    }
}
